test(github-backup): stubbed shell test for drain-wrapper.sh Bitwarden fallback branches (#5222) - #8658
Merged
Conversation
…n fallback branches (#5222)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the missing test coverage for the github-backup drainer's Bitwarden credential fallback (#5222):
infra/github-backup/systemd/drain-wrapper.test.sh, a stubbed shell test in the repo's shell-test conventions (cf.infra/dns/test_save_atomic.sh,lib/run-switch.test.sh), plus ascripts-testCI step in the run-switch pattern so it actually runs.What is covered
The stub
bwsworks only whenBWS_ACCESS_TOKENis exactly the stub token and serves the two secret names the wrapper fetches with fixed stub values; the drain entry point (../bin/drain_queue.py) is a stub that records the environment it was exec'd with. No real credential appears anywhere. Branches:~/.config/bws/access-token→ wrapper exports it, drain runs.bwsfails →~/tools/bws-env.shis sourced →bwsworks, drain runs.The wrapper is invoked via
env -iwith a controlled HOME/PATH: hosts that inject credential helpers into shells (exported functions / BASH_ENV) would otherwise supply a real token and defeat the stub — observed on the dev laptop, where the config-file case failed until the environment was cleaned.Evidence
bash infra/github-backup/systemd/drain-wrapper.test.sh→ 13/13 checks PASS, exit 0.lib/sops-atomic-writers.test.shexit 0,lib/run-switch.test.shexit 0.drain-wrapper.shitself is unchanged (the packet's exclude: no behavior change without a failing test showing a broken branch — all branches behave as documented).Fleet task 8957 (lane any-a). The task's lane row was bound to a cleared legacy opencode session (ses_e5e37ae0456...; cleared 2026-11-11T02:02Z, flip refused), the prior
user/reviewwas reviewed by lane M (proceed, no Drew decision), and the pickup/blocking state is recorded on #5222 — this PR is the direct execution of the reviewed packet.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.